Scenario #9312: Newly Created Account for Existing Natural Person Should Be Able to View Existing Relations

Properties

Required

Given

name value
subjectName xyz-peter.smith

Expected

name value
expectedRelationsJson [
  {
    “type”: “REPRESENTATIVE”,
    “anchor”: { “tradeName”: “Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.” },
    “holder”: { “givenName”: “Peter”, “familyName”: “Smith” },
    “contact”: { “emailAddresses”: { “main”: “contact-admin@secondcontact.example.com” } }
  },
  {
    “type”: “PARTNER”,
    “anchor”: { “tradeName”: “Hostsharing eG” },
    “holder”: { “givenName”: “Peter”, “familyName”: “Smith” },
    “contact”: { “emailAddresses”: { “main”: “contact-admin@sixthcontact.example.com” } }
  },
  {
    “type”: “DEBITOR”,
    “anchor”: { “givenName”: “Peter”, “familyName”: “Smith” },
    “holder”: { “givenName”: “Peter”, “familyName”: “Smith” },
    “contact”: { “emailAddresses”: { “main”: “contact-admin@thirdcontact.example.com” } }
  },
  {
    “type”: “SUBSCRIBER”,
    “mark”: “members-announce”,
    “anchor”: { “tradeName”: “Third OHG” },
    “holder”: { “givenName”: “Peter”, “familyName”: “Smith” },
    “contact”: { “emailAddresses”: { “main”: “contact-admin@thirdcontact.example.com” } }
  }
]

personUuid

HTTP GET "/api/hs/accounts/accounts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<xyz-peter.smith>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "242a0002-0000-0000-0000-000000000002", // Account: xyz-peter.smith
  "person" : {
    "uuid" : "bfecf1fc-b92b-47ae-aa84-9d52b57457ef", // personUuid
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "subject" : {
    "uuid" : "242a0002-0000-0000-0000-000000000002", // Account: xyz-peter.smith
    "name" : "xyz-peter.smith",
    "type" : "USER"
  },
  "globalUid" : 21011,
  "globalGid" : 21011
} ]

Fetch the account for the current subject to resolve the related person.

View their relations

HTTP GET "/api/hs/office/relations?personUuid=bfecf1fc-b92b-47ae-aa84-9d52b57457ef" // personUuid \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<xyz-peter.smith>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "0a5c8f85-fbe0-4fce-8282-3da014b27d8f",
  "anchor" : {
    "uuid" : "65eac828-db90-482d-ad56-e95329e1b82f",
    "personType" : "LEGAL_PERSON",
    "tradeName" : "Peter Smith - The Second Hand and Thrift Stores-n-Shipping e.K.",
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "holder" : {
    "uuid" : "bfecf1fc-b92b-47ae-aa84-9d52b57457ef", // personUuid
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "type" : "REPRESENTATIVE",
  "mark" : null,
  "contact" : {
    "uuid" : "c888c87c-85dd-474c-83e4-22b833c2bead",
    "caption" : "second contact",
    "postalAddress" : {
      "country" : "Germany"
    },
    "emailAddresses" : {
      "main" : "contact-admin@secondcontact.example.com"
    },
    "phoneNumbers" : {
      "phone_office" : "+49 123 1234567"
    }
  }
}, {
  "uuid" : "f1e3a7a5-b989-4868-9555-cb520da66d41",
  "anchor" : {
    "uuid" : "bfecf1fc-b92b-47ae-aa84-9d52b57457ef", // personUuid
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "holder" : {
    "uuid" : "bfecf1fc-b92b-47ae-aa84-9d52b57457ef", // personUuid
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "type" : "DEBITOR",
  "mark" : null,
  "contact" : {
    "uuid" : "5f006104-6664-4f02-a75e-d9a30486bc73",
    "caption" : "third contact",
    "postalAddress" : {
      "country" : "Germany"
    },
    "emailAddresses" : {
      "main" : "contact-admin@thirdcontact.example.com"
    },
    "phoneNumbers" : {
      "phone_office" : "+49 123 1234567"
    }
  }
}, {
  "uuid" : "fb5bacc6-229f-4409-a83e-b7161e2276b4",
  "anchor" : {
    "uuid" : "90dc3049-d8c2-487f-bfcc-69f9e4172622",
    "personType" : "INCORPORATED_FIRM",
    "tradeName" : "Third OHG",
    "salutation" : null,
    "title" : null,
    "givenName" : null,
    "familyName" : null
  },
  "holder" : {
    "uuid" : "bfecf1fc-b92b-47ae-aa84-9d52b57457ef", // personUuid
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "type" : "SUBSCRIBER",
  "mark" : "members-announce",
  "contact" : {
    "uuid" : "5f006104-6664-4f02-a75e-d9a30486bc73",
    "caption" : "third contact",
    "postalAddress" : {
      "country" : "Germany"
    },
    "emailAddresses" : {
      "main" : "contact-admin@thirdcontact.example.com"
    },
    "phoneNumbers" : {
      "phone_office" : "+49 123 1234567"
    }
  }
}, {
  "uuid" : "be33426d-fff5-4477-bc35-975b7ae62cbb",
  "anchor" : {
    "uuid" : "bb7b76f1-1922-46aa-8c22-468c70c3a9fa",
    "personType" : "LEGAL_PERSON",
    "tradeName" : "Hostsharing eG",
    "salutation" : null,
    "title" : null,
    "givenName" : null,
    "familyName" : null
  },
  "holder" : {
    "uuid" : "bfecf1fc-b92b-47ae-aa84-9d52b57457ef", // personUuid
    "personType" : "NATURAL_PERSON",
    "tradeName" : null,
    "salutation" : null,
    "title" : null,
    "givenName" : "Peter",
    "familyName" : "Smith"
  },
  "type" : "PARTNER",
  "mark" : null,
  "contact" : {
    "uuid" : "6ee41fbe-a4be-4307-af07-7811ec828dff",
    "caption" : "sixth contact",
    "postalAddress" : {
      "country" : "Germany"
    },
    "emailAddresses" : {
      "main" : "contact-admin@sixthcontact.example.com"
    },
    "phoneNumbers" : {
      "phone_office" : "+49 123 1234567"
    }
  }
} ]

generated on 2026-07-17 01:42:20 for branch